using System;
using System.Data;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using PCSComUtils.Common;
using PCSUtils.Utils;
using PCSComUtils.Common.BO;
using PCSComUtils.PCSExc;
using PCSUtils.Log;

namespace PCSProduction.DCP
{
	/// <summary>
	/// Summary description for OutOfCapacityWC.
	/// </summary>
	public class OutOfCapacityWC : System.Windows.Forms.Form
	{
		private System.Windows.Forms.Button btnClose;
		private C1.Win.C1TrueDBGrid.C1TrueDBGrid tgridOverCapacityWC;
		private System.Windows.Forms.Label lblMessage;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;
		private System.Windows.Forms.ContextMenu ctxmnuClipboard;
		private System.Windows.Forms.MenuItem mnuCopy;
		private System.Windows.Forms.MenuItem mnuSelectAll;
		private System.Windows.Forms.Button btnShiftPattern;
		private System.Windows.Forms.Button btnWCCapacity;

		private const string THIS = "PCSProduction.DCP.OutOfCapacityWC";		

		public OutOfCapacityWC()
		{
			//
			// Required for Windows Form Designer support
			//
			InitializeComponent();

			//
			// TODO: Add any constructor code after InitializeComponent call
			//
		}

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if(components != null)
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
			System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(OutOfCapacityWC));
			this.tgridOverCapacityWC = new C1.Win.C1TrueDBGrid.C1TrueDBGrid();
			this.ctxmnuClipboard = new System.Windows.Forms.ContextMenu();
			this.mnuSelectAll = new System.Windows.Forms.MenuItem();
			this.mnuCopy = new System.Windows.Forms.MenuItem();
			this.btnClose = new System.Windows.Forms.Button();
			this.lblMessage = new System.Windows.Forms.Label();
			this.btnShiftPattern = new System.Windows.Forms.Button();
			this.btnWCCapacity = new System.Windows.Forms.Button();
			((System.ComponentModel.ISupportInitialize)(this.tgridOverCapacityWC)).BeginInit();
			this.SuspendLayout();
			// 
			// tgridOverCapacityWC
			// 
			this.tgridOverCapacityWC.AccessibleDescription = resources.GetString("tgridOverCapacityWC.AccessibleDescription");
			this.tgridOverCapacityWC.AccessibleName = resources.GetString("tgridOverCapacityWC.AccessibleName");
			this.tgridOverCapacityWC.AllowAddNew = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowAddNew")));
			this.tgridOverCapacityWC.AllowArrows = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowArrows")));
			this.tgridOverCapacityWC.AllowColMove = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowColMove")));
			this.tgridOverCapacityWC.AllowColSelect = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowColSelect")));
			this.tgridOverCapacityWC.AllowDelete = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowDelete")));
			this.tgridOverCapacityWC.AllowDrag = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowDrag")));
			this.tgridOverCapacityWC.AllowFilter = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowFilter")));
			this.tgridOverCapacityWC.AllowHorizontalSplit = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowHorizontalSplit")));
			this.tgridOverCapacityWC.AllowRowSelect = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowRowSelect")));
			this.tgridOverCapacityWC.AllowSort = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowSort")));
			this.tgridOverCapacityWC.AllowUpdate = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowUpdate")));
			this.tgridOverCapacityWC.AllowUpdateOnBlur = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowUpdateOnBlur")));
			this.tgridOverCapacityWC.AllowVerticalSplit = ((bool)(resources.GetObject("tgridOverCapacityWC.AllowVerticalSplit")));
			this.tgridOverCapacityWC.AlternatingRows = ((bool)(resources.GetObject("tgridOverCapacityWC.AlternatingRows")));
			this.tgridOverCapacityWC.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("tgridOverCapacityWC.Anchor")));
			this.tgridOverCapacityWC.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("tgridOverCapacityWC.BackgroundImage")));
			this.tgridOverCapacityWC.BorderStyle = ((System.Windows.Forms.BorderStyle)(resources.GetObject("tgridOverCapacityWC.BorderStyle")));
			this.tgridOverCapacityWC.Caption = resources.GetString("tgridOverCapacityWC.Caption");
			this.tgridOverCapacityWC.CaptionHeight = ((int)(resources.GetObject("tgridOverCapacityWC.CaptionHeight")));
			this.tgridOverCapacityWC.CellTipsDelay = ((int)(resources.GetObject("tgridOverCapacityWC.CellTipsDelay")));
			this.tgridOverCapacityWC.CellTipsWidth = ((int)(resources.GetObject("tgridOverCapacityWC.CellTipsWidth")));
			this.tgridOverCapacityWC.ChildGrid = ((C1.Win.C1TrueDBGrid.C1TrueDBGrid)(resources.GetObject("tgridOverCapacityWC.ChildGrid")));
			this.tgridOverCapacityWC.CollapseColor = ((System.Drawing.Color)(resources.GetObject("tgridOverCapacityWC.CollapseColor")));
			this.tgridOverCapacityWC.ColumnFooters = ((bool)(resources.GetObject("tgridOverCapacityWC.ColumnFooters")));
			this.tgridOverCapacityWC.ColumnHeaders = ((bool)(resources.GetObject("tgridOverCapacityWC.ColumnHeaders")));
			this.tgridOverCapacityWC.ContextMenu = this.ctxmnuClipboard;
			this.tgridOverCapacityWC.DefColWidth = ((int)(resources.GetObject("tgridOverCapacityWC.DefColWidth")));
			this.tgridOverCapacityWC.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("tgridOverCapacityWC.Dock")));
			this.tgridOverCapacityWC.EditDropDown = ((bool)(resources.GetObject("tgridOverCapacityWC.EditDropDown")));
			this.tgridOverCapacityWC.EmptyRows = ((bool)(resources.GetObject("tgridOverCapacityWC.EmptyRows")));
			this.tgridOverCapacityWC.Enabled = ((bool)(resources.GetObject("tgridOverCapacityWC.Enabled")));
			this.tgridOverCapacityWC.ExpandColor = ((System.Drawing.Color)(resources.GetObject("tgridOverCapacityWC.ExpandColor")));
			this.tgridOverCapacityWC.ExposeCellMode = ((C1.Win.C1TrueDBGrid.ExposeCellModeEnum)(resources.GetObject("tgridOverCapacityWC.ExposeCellMode")));
			this.tgridOverCapacityWC.ExtendRightColumn = ((bool)(resources.GetObject("tgridOverCapacityWC.ExtendRightColumn")));
			this.tgridOverCapacityWC.FetchRowStyles = ((bool)(resources.GetObject("tgridOverCapacityWC.FetchRowStyles")));
			this.tgridOverCapacityWC.FilterBar = ((bool)(resources.GetObject("tgridOverCapacityWC.FilterBar")));
			this.tgridOverCapacityWC.FlatStyle = ((C1.Win.C1TrueDBGrid.FlatModeEnum)(resources.GetObject("tgridOverCapacityWC.FlatStyle")));
			this.tgridOverCapacityWC.Font = ((System.Drawing.Font)(resources.GetObject("tgridOverCapacityWC.Font")));
			this.tgridOverCapacityWC.GroupByAreaVisible = ((bool)(resources.GetObject("tgridOverCapacityWC.GroupByAreaVisible")));
			this.tgridOverCapacityWC.GroupByCaption = resources.GetString("tgridOverCapacityWC.GroupByCaption");
			this.tgridOverCapacityWC.Images.Add(((System.Drawing.Image)(resources.GetObject("resource"))));
			this.tgridOverCapacityWC.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("tgridOverCapacityWC.ImeMode")));
			this.tgridOverCapacityWC.LinesPerRow = ((int)(resources.GetObject("tgridOverCapacityWC.LinesPerRow")));
			this.tgridOverCapacityWC.Location = ((System.Drawing.Point)(resources.GetObject("tgridOverCapacityWC.Location")));
			this.tgridOverCapacityWC.MarqueeStyle = C1.Win.C1TrueDBGrid.MarqueeEnum.DottedCellBorder;
			this.tgridOverCapacityWC.Name = "tgridOverCapacityWC";
			this.tgridOverCapacityWC.PictureAddnewRow = ((System.Drawing.Image)(resources.GetObject("tgridOverCapacityWC.PictureAddnewRow")));
			this.tgridOverCapacityWC.PictureCurrentRow = ((System.Drawing.Image)(resources.GetObject("tgridOverCapacityWC.PictureCurrentRow")));
			this.tgridOverCapacityWC.PictureFilterBar = ((System.Drawing.Image)(resources.GetObject("tgridOverCapacityWC.PictureFilterBar")));
			this.tgridOverCapacityWC.PictureFooterRow = ((System.Drawing.Image)(resources.GetObject("tgridOverCapacityWC.PictureFooterRow")));
			this.tgridOverCapacityWC.PictureHeaderRow = ((System.Drawing.Image)(resources.GetObject("tgridOverCapacityWC.PictureHeaderRow")));
			this.tgridOverCapacityWC.PictureModifiedRow = ((System.Drawing.Image)(resources.GetObject("tgridOverCapacityWC.PictureModifiedRow")));
			this.tgridOverCapacityWC.PictureStandardRow = ((System.Drawing.Image)(resources.GetObject("tgridOverCapacityWC.PictureStandardRow")));
			this.tgridOverCapacityWC.PreviewInfo.AllowSizing = ((bool)(resources.GetObject("tgridOverCapacityWC.PreviewInfo.AllowSizing")));
			this.tgridOverCapacityWC.PreviewInfo.Caption = resources.GetString("tgridOverCapacityWC.PreviewInfo.Caption");
			this.tgridOverCapacityWC.PreviewInfo.Location = ((System.Drawing.Point)(resources.GetObject("tgridOverCapacityWC.PreviewInfo.Location")));
			this.tgridOverCapacityWC.PreviewInfo.Size = ((System.Drawing.Size)(resources.GetObject("tgridOverCapacityWC.PreviewInfo.Size")));
			this.tgridOverCapacityWC.PreviewInfo.ToolBars = ((bool)(resources.GetObject("tgridOverCapacityWC.PreviewInfo.ToolBars")));
			this.tgridOverCapacityWC.PreviewInfo.UIStrings.Content = ((string[])(resources.GetObject("tgridOverCapacityWC.PreviewInfo.UIStrings.Content")));
			this.tgridOverCapacityWC.PreviewInfo.ZoomFactor = ((System.Double)(resources.GetObject("tgridOverCapacityWC.PreviewInfo.ZoomFactor")));
			this.tgridOverCapacityWC.PrintInfo.MaxRowHeight = ((int)(resources.GetObject("tgridOverCapacityWC.PrintInfo.MaxRowHeight")));
			this.tgridOverCapacityWC.PrintInfo.OwnerDrawPageFooter = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.OwnerDrawPageFooter")));
			this.tgridOverCapacityWC.PrintInfo.OwnerDrawPageHeader = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.OwnerDrawPageHeader")));
			this.tgridOverCapacityWC.PrintInfo.PageFooter = resources.GetString("tgridOverCapacityWC.PrintInfo.PageFooter");
			this.tgridOverCapacityWC.PrintInfo.PageFooterHeight = ((int)(resources.GetObject("tgridOverCapacityWC.PrintInfo.PageFooterHeight")));
			this.tgridOverCapacityWC.PrintInfo.PageHeader = resources.GetString("tgridOverCapacityWC.PrintInfo.PageHeader");
			this.tgridOverCapacityWC.PrintInfo.PageHeaderHeight = ((int)(resources.GetObject("tgridOverCapacityWC.PrintInfo.PageHeaderHeight")));
			this.tgridOverCapacityWC.PrintInfo.PrintHorizontalSplits = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.PrintHorizontalSplits")));
			this.tgridOverCapacityWC.PrintInfo.ProgressCaption = resources.GetString("tgridOverCapacityWC.PrintInfo.ProgressCaption");
			this.tgridOverCapacityWC.PrintInfo.RepeatColumnFooters = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.RepeatColumnFooters")));
			this.tgridOverCapacityWC.PrintInfo.RepeatColumnHeaders = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.RepeatColumnHeaders")));
			this.tgridOverCapacityWC.PrintInfo.RepeatGridHeader = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.RepeatGridHeader")));
			this.tgridOverCapacityWC.PrintInfo.RepeatSplitHeaders = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.RepeatSplitHeaders")));
			this.tgridOverCapacityWC.PrintInfo.ShowOptionsDialog = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.ShowOptionsDialog")));
			this.tgridOverCapacityWC.PrintInfo.ShowProgressForm = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.ShowProgressForm")));
			this.tgridOverCapacityWC.PrintInfo.ShowSelection = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.ShowSelection")));
			this.tgridOverCapacityWC.PrintInfo.UseGridColors = ((bool)(resources.GetObject("tgridOverCapacityWC.PrintInfo.UseGridColors")));
			this.tgridOverCapacityWC.RecordSelectors = ((bool)(resources.GetObject("tgridOverCapacityWC.RecordSelectors")));
			this.tgridOverCapacityWC.RecordSelectorWidth = ((int)(resources.GetObject("tgridOverCapacityWC.RecordSelectorWidth")));
			this.tgridOverCapacityWC.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("tgridOverCapacityWC.RightToLeft")));
			this.tgridOverCapacityWC.RowDivider.Color = ((System.Drawing.Color)(resources.GetObject("resource.Color")));
			this.tgridOverCapacityWC.RowDivider.Style = ((C1.Win.C1TrueDBGrid.LineStyleEnum)(resources.GetObject("resource.Style")));
			this.tgridOverCapacityWC.RowHeight = ((int)(resources.GetObject("tgridOverCapacityWC.RowHeight")));
			this.tgridOverCapacityWC.RowSubDividerColor = ((System.Drawing.Color)(resources.GetObject("tgridOverCapacityWC.RowSubDividerColor")));
			this.tgridOverCapacityWC.ScrollTips = ((bool)(resources.GetObject("tgridOverCapacityWC.ScrollTips")));
			this.tgridOverCapacityWC.ScrollTrack = ((bool)(resources.GetObject("tgridOverCapacityWC.ScrollTrack")));
			this.tgridOverCapacityWC.Size = ((System.Drawing.Size)(resources.GetObject("tgridOverCapacityWC.Size")));
			this.tgridOverCapacityWC.SpringMode = ((bool)(resources.GetObject("tgridOverCapacityWC.SpringMode")));
			this.tgridOverCapacityWC.TabAcrossSplits = ((bool)(resources.GetObject("tgridOverCapacityWC.TabAcrossSplits")));
			this.tgridOverCapacityWC.TabIndex = ((int)(resources.GetObject("tgridOverCapacityWC.TabIndex")));
			this.tgridOverCapacityWC.Text = resources.GetString("tgridOverCapacityWC.Text");
			this.tgridOverCapacityWC.ViewCaptionWidth = ((int)(resources.GetObject("tgridOverCapacityWC.ViewCaptionWidth")));
			this.tgridOverCapacityWC.ViewColumnWidth = ((int)(resources.GetObject("tgridOverCapacityWC.ViewColumnWidth")));
			this.tgridOverCapacityWC.Visible = ((bool)(resources.GetObject("tgridOverCapacityWC.Visible")));
			this.tgridOverCapacityWC.WrapCellPointer = ((bool)(resources.GetObject("tgridOverCapacityWC.WrapCellPointer")));
			this.tgridOverCapacityWC.PropBag = resources.GetString("tgridOverCapacityWC.PropBag");
			// 
			// ctxmnuClipboard
			// 
			this.ctxmnuClipboard.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
																							this.mnuSelectAll,
																							this.mnuCopy});
			this.ctxmnuClipboard.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("ctxmnuClipboard.RightToLeft")));
			// 
			// mnuSelectAll
			// 
			this.mnuSelectAll.Enabled = ((bool)(resources.GetObject("mnuSelectAll.Enabled")));
			this.mnuSelectAll.Index = 0;
			this.mnuSelectAll.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("mnuSelectAll.Shortcut")));
			this.mnuSelectAll.ShowShortcut = ((bool)(resources.GetObject("mnuSelectAll.ShowShortcut")));
			this.mnuSelectAll.Text = resources.GetString("mnuSelectAll.Text");
			this.mnuSelectAll.Visible = ((bool)(resources.GetObject("mnuSelectAll.Visible")));
			this.mnuSelectAll.Click += new System.EventHandler(this.mnuSelectAll_Click);
			// 
			// mnuCopy
			// 
			this.mnuCopy.Enabled = ((bool)(resources.GetObject("mnuCopy.Enabled")));
			this.mnuCopy.Index = 1;
			this.mnuCopy.Shortcut = ((System.Windows.Forms.Shortcut)(resources.GetObject("mnuCopy.Shortcut")));
			this.mnuCopy.ShowShortcut = ((bool)(resources.GetObject("mnuCopy.ShowShortcut")));
			this.mnuCopy.Text = resources.GetString("mnuCopy.Text");
			this.mnuCopy.Visible = ((bool)(resources.GetObject("mnuCopy.Visible")));
			this.mnuCopy.Click += new System.EventHandler(this.mnuCopy_Click);
			// 
			// btnClose
			// 
			this.btnClose.AccessibleDescription = resources.GetString("btnClose.AccessibleDescription");
			this.btnClose.AccessibleName = resources.GetString("btnClose.AccessibleName");
			this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnClose.Anchor")));
			this.btnClose.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnClose.BackgroundImage")));
			this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnClose.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnClose.Dock")));
			this.btnClose.Enabled = ((bool)(resources.GetObject("btnClose.Enabled")));
			this.btnClose.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnClose.FlatStyle")));
			this.btnClose.Font = ((System.Drawing.Font)(resources.GetObject("btnClose.Font")));
			this.btnClose.Image = ((System.Drawing.Image)(resources.GetObject("btnClose.Image")));
			this.btnClose.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.ImageAlign")));
			this.btnClose.ImageIndex = ((int)(resources.GetObject("btnClose.ImageIndex")));
			this.btnClose.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnClose.ImeMode")));
			this.btnClose.Location = ((System.Drawing.Point)(resources.GetObject("btnClose.Location")));
			this.btnClose.Name = "btnClose";
			this.btnClose.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnClose.RightToLeft")));
			this.btnClose.Size = ((System.Drawing.Size)(resources.GetObject("btnClose.Size")));
			this.btnClose.TabIndex = ((int)(resources.GetObject("btnClose.TabIndex")));
			this.btnClose.Text = resources.GetString("btnClose.Text");
			this.btnClose.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnClose.TextAlign")));
			this.btnClose.Visible = ((bool)(resources.GetObject("btnClose.Visible")));
			// 
			// lblMessage
			// 
			this.lblMessage.AccessibleDescription = resources.GetString("lblMessage.AccessibleDescription");
			this.lblMessage.AccessibleName = resources.GetString("lblMessage.AccessibleName");
			this.lblMessage.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblMessage.Anchor")));
			this.lblMessage.AutoSize = ((bool)(resources.GetObject("lblMessage.AutoSize")));
			this.lblMessage.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblMessage.Dock")));
			this.lblMessage.Enabled = ((bool)(resources.GetObject("lblMessage.Enabled")));
			this.lblMessage.Font = ((System.Drawing.Font)(resources.GetObject("lblMessage.Font")));
			this.lblMessage.Image = ((System.Drawing.Image)(resources.GetObject("lblMessage.Image")));
			this.lblMessage.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblMessage.ImageAlign")));
			this.lblMessage.ImageIndex = ((int)(resources.GetObject("lblMessage.ImageIndex")));
			this.lblMessage.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblMessage.ImeMode")));
			this.lblMessage.Location = ((System.Drawing.Point)(resources.GetObject("lblMessage.Location")));
			this.lblMessage.Name = "lblMessage";
			this.lblMessage.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblMessage.RightToLeft")));
			this.lblMessage.Size = ((System.Drawing.Size)(resources.GetObject("lblMessage.Size")));
			this.lblMessage.TabIndex = ((int)(resources.GetObject("lblMessage.TabIndex")));
			this.lblMessage.Text = resources.GetString("lblMessage.Text");
			this.lblMessage.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblMessage.TextAlign")));
			this.lblMessage.Visible = ((bool)(resources.GetObject("lblMessage.Visible")));
			// 
			// btnShiftPattern
			// 
			this.btnShiftPattern.AccessibleDescription = resources.GetString("btnShiftPattern.AccessibleDescription");
			this.btnShiftPattern.AccessibleName = resources.GetString("btnShiftPattern.AccessibleName");
			this.btnShiftPattern.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnShiftPattern.Anchor")));
			this.btnShiftPattern.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnShiftPattern.BackgroundImage")));
			this.btnShiftPattern.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnShiftPattern.Dock")));
			this.btnShiftPattern.Enabled = ((bool)(resources.GetObject("btnShiftPattern.Enabled")));
			this.btnShiftPattern.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnShiftPattern.FlatStyle")));
			this.btnShiftPattern.Font = ((System.Drawing.Font)(resources.GetObject("btnShiftPattern.Font")));
			this.btnShiftPattern.Image = ((System.Drawing.Image)(resources.GetObject("btnShiftPattern.Image")));
			this.btnShiftPattern.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnShiftPattern.ImageAlign")));
			this.btnShiftPattern.ImageIndex = ((int)(resources.GetObject("btnShiftPattern.ImageIndex")));
			this.btnShiftPattern.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnShiftPattern.ImeMode")));
			this.btnShiftPattern.Location = ((System.Drawing.Point)(resources.GetObject("btnShiftPattern.Location")));
			this.btnShiftPattern.Name = "btnShiftPattern";
			this.btnShiftPattern.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnShiftPattern.RightToLeft")));
			this.btnShiftPattern.Size = ((System.Drawing.Size)(resources.GetObject("btnShiftPattern.Size")));
			this.btnShiftPattern.TabIndex = ((int)(resources.GetObject("btnShiftPattern.TabIndex")));
			this.btnShiftPattern.Text = resources.GetString("btnShiftPattern.Text");
			this.btnShiftPattern.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnShiftPattern.TextAlign")));
			this.btnShiftPattern.Visible = ((bool)(resources.GetObject("btnShiftPattern.Visible")));
			this.btnShiftPattern.Click += new System.EventHandler(this.btnShiftPattern_Click);
			// 
			// btnWCCapacity
			// 
			this.btnWCCapacity.AccessibleDescription = resources.GetString("btnWCCapacity.AccessibleDescription");
			this.btnWCCapacity.AccessibleName = resources.GetString("btnWCCapacity.AccessibleName");
			this.btnWCCapacity.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnWCCapacity.Anchor")));
			this.btnWCCapacity.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnWCCapacity.BackgroundImage")));
			this.btnWCCapacity.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnWCCapacity.Dock")));
			this.btnWCCapacity.Enabled = ((bool)(resources.GetObject("btnWCCapacity.Enabled")));
			this.btnWCCapacity.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnWCCapacity.FlatStyle")));
			this.btnWCCapacity.Font = ((System.Drawing.Font)(resources.GetObject("btnWCCapacity.Font")));
			this.btnWCCapacity.Image = ((System.Drawing.Image)(resources.GetObject("btnWCCapacity.Image")));
			this.btnWCCapacity.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnWCCapacity.ImageAlign")));
			this.btnWCCapacity.ImageIndex = ((int)(resources.GetObject("btnWCCapacity.ImageIndex")));
			this.btnWCCapacity.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnWCCapacity.ImeMode")));
			this.btnWCCapacity.Location = ((System.Drawing.Point)(resources.GetObject("btnWCCapacity.Location")));
			this.btnWCCapacity.Name = "btnWCCapacity";
			this.btnWCCapacity.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnWCCapacity.RightToLeft")));
			this.btnWCCapacity.Size = ((System.Drawing.Size)(resources.GetObject("btnWCCapacity.Size")));
			this.btnWCCapacity.TabIndex = ((int)(resources.GetObject("btnWCCapacity.TabIndex")));
			this.btnWCCapacity.Text = resources.GetString("btnWCCapacity.Text");
			this.btnWCCapacity.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnWCCapacity.TextAlign")));
			this.btnWCCapacity.Visible = ((bool)(resources.GetObject("btnWCCapacity.Visible")));
			this.btnWCCapacity.Click += new System.EventHandler(this.btnWCCapacity_Click);
			// 
			// OutOfCapacityWC
			// 
			this.AccessibleDescription = resources.GetString("$this.AccessibleDescription");
			this.AccessibleName = resources.GetString("$this.AccessibleName");
			this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize")));
			this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll")));
			this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin")));
			this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize")));
			this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
			this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize")));
			this.Controls.Add(this.btnWCCapacity);
			this.Controls.Add(this.btnShiftPattern);
			this.Controls.Add(this.lblMessage);
			this.Controls.Add(this.btnClose);
			this.Controls.Add(this.tgridOverCapacityWC);
			this.Enabled = ((bool)(resources.GetObject("$this.Enabled")));
			this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font")));
			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
			this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
			this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode")));
			this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location")));
			this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize")));
			this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize")));
			this.Name = "OutOfCapacityWC";
			this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft")));
			this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition")));
			this.Text = resources.GetString("$this.Text");
			this.Load += new System.EventHandler(this.OutOfCapacityWC_Load);
			((System.ComponentModel.ISupportInitialize)(this.tgridOverCapacityWC)).EndInit();
			this.ResumeLayout(false);

		}
		#endregion

		private DataTable m_dtbOverCapacityWC;
		private int m_intCycleOptionID;

		public DataTable OverCapacityWC
		{
			set
			{
				m_dtbOverCapacityWC = value;
			}
		}

		public int CycleOptionID
		{
			set
			{
				m_intCycleOptionID = value;
			}
		}

		private void OutOfCapacityWC_Load(object sender, System.EventArgs e)
		{
			const string OVERDAYS_COL = "OverDays";
			const string OVERPERCENT_COL = "OverPercent";

			const string METHOD_NAME = THIS + ".OutOfCapacityWC_Load()";

			try
			{
				Security objSecurity = new Security();
				this.Name = THIS;
				if (objSecurity.SetRightForUserOnForm(this, SystemProperty.UserName) == 0)
				{
					this.Close();
					return;
				}

				if (m_dtbOverCapacityWC != null)
				{
					DataTable dtbLayout = FormControlComponents.StoreGridLayout(tgridOverCapacityWC);
					tgridOverCapacityWC.DataSource = m_dtbOverCapacityWC;
					FormControlComponents.RestoreGridLayout(tgridOverCapacityWC,dtbLayout);
					tgridOverCapacityWC.Columns[OVERDAYS_COL].NumberFormat = Constants.DECIMAL_NUMBERFORMAT;
					tgridOverCapacityWC.Columns[OVERPERCENT_COL].NumberFormat = Constants.DECIMAL_NUMBERFORMAT;
				}
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{		
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void mnuCopy_Click(object sender, System.EventArgs e)
		{
			string  strTemp = string.Empty;   //string to be copied to the clipboard

			if (tgridOverCapacityWC.SelectedRows.Count > 0 ) 
			{
				foreach (int row in tgridOverCapacityWC.SelectedRows)
				{
					foreach (C1.Win.C1TrueDBGrid.C1DataColumn col in tgridOverCapacityWC.SelectedCols)
						strTemp = strTemp + col.CellText(row) + "\t"; 
					strTemp = strTemp + "\r\n";
				}
			} //
			System.Windows.Forms.Clipboard.SetDataObject(strTemp, false);		
		}

		private void mnuSelectAll_Click(object sender, System.EventArgs e)
		{
			for (int i=0; i < tgridOverCapacityWC.Splits[0].Rows.Count; i++)
			{
				tgridOverCapacityWC.SelectedRows.Add(i);
			}		
		}

		private void btnWorkDayCalendar_Click(object sender, System.EventArgs e)
		{
		}

		private void btnShiftPattern_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnShiftPattern_Click()";

			try
			{
				ShiftPattern frmShiftPattern = new ShiftPattern();
				frmShiftPattern.ShowDialog(this);
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{		
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
		}

		private void btnWCCapacity_Click(object sender, System.EventArgs e)
		{
			const string METHOD_NAME = THIS + ".btnWCCapacity_Click()";

			try
			{
				int intWorkCenterID = Convert.ToInt32(tgridOverCapacityWC.Columns[MST_WorkCenterTable.WORKCENTERID_FLD].Value);
				WorkCenterCapacity frmWCCapacity = new WorkCenterCapacity(intWorkCenterID,m_intCycleOptionID);
				frmWCCapacity.ShowDialog(this);
			}
			catch (PCSException ex)
			{
				PCSMessageBox.Show(ex.mCode, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex.CauseException, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}
			catch (Exception ex)
			{		
				PCSMessageBox.Show(ErrorCode.OTHER_ERROR, MessageBoxIcon.Error);
				try
				{
					Logger.LogMessage(ex, METHOD_NAME, Level.ERROR);
				}
				catch
				{
					PCSMessageBox.Show(ErrorCode.LOG_EXCEPTION, MessageBoxIcon.Error);
				}
			}

		}
	}
}
